home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 47215 / 47215.xpi / chrome / content / lib / strings.js < prev    next >
Text File  |  2009-11-22  |  419b  |  30 lines

  1. (function()
  2. {
  3.     //decodes all chars encoded in a string
  4.     this.decodeUTF8Recursive = function(aString)//recursion was optimized
  5.     {
  6.         while(aString.indexOf('%') != -1)
  7.         {
  8.             try
  9.             {
  10.                 aString = decodeURIComponent(aString);
  11.             }
  12.             catch(e)
  13.             {
  14.                 try
  15.                 {
  16.                     aString = decodeURI(aString);
  17.                 }
  18.                 catch(e)
  19.                 {
  20.                     return aString;
  21.                 }
  22.             }
  23.         }
  24.         return aString;
  25.     };
  26.  
  27.     return null;
  28.  
  29. }).apply(URLtoTabTitle);
  30.